package com.youyi.yypermissionlibrary.core;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.support.v7.app.AppCompatActivity;
import com.youyi.yypermissionlibrary.SDK.YYPerUtils;

public class AcpActivity11 extends AppCompatActivity {
    private boolean mHasJump;
    private Intent mIntent;

    /* access modifiers changed from: protected */
    @Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.SupportActivity, android.support.v4.app.FragmentActivity
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        getWindow().addFlags(16);
    }

    /* access modifiers changed from: protected */
    @Override // android.support.v4.app.FragmentActivity
    public void onResume() {
        super.onResume();
        if (!this.mHasJump) {
            this.mHasJump = true;
            Intent intent = new Intent("android.settings.MANAGE_APP_ALL_FILES_ACCESS_PERMISSION");
            this.mIntent = intent;
            intent.setData(Uri.parse("package:" + getPackageName()));
            this.mIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            startActivity(this.mIntent);
            return;
        }
        if (YYPerUtils.acpListener11 != null) {
            if (Environment.isExternalStorageManager()) {
                YYPerUtils.acpListener11.onGranted();
            } else {
                YYPerUtils.acpListener11.onDenied(null);
            }
        }
        YYPerUtils.acpListener11 = null;
        finish();
    }
}
